home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / language / dino / dino_bot.1 / examples / helloworld / ex3.d < prev    next >
Encoding:
Text File  |  1991-03-10  |  1.1 KB  |  42 lines

  1. /* Copyright, 1990, Regents of the University of Colorado */
  2. /* This program prints out messages from two composite procedures, inside of a
  3.  * single one dimensional environment structure. */
  4.  
  5. #define P 14
  6.  
  7. environment node[P:id] {        /* ==> The size of an environment structure
  8.                                        does not have to be a power of two */
  9.  
  10.   composite part1()
  11.  
  12.   {
  13.     printf ("node[%d] says hello from part1()#\n", id);
  14.   }
  15.  
  16.   composite part2()             /* ==> Multiple composite procedures may be
  17.                                        declared within the same environment
  18.                                        structure.  However, only one of these
  19.                                        may be active at any one time. */
  20.  
  21.   {
  22.     printf ("node[%d] says hello from part2()#\n", id);
  23.   }
  24.  
  25. }
  26.  
  27. environment host {
  28.  
  29.   void main ()
  30.  
  31.   {
  32.     printf ("host says hello\n");
  33.  
  34.     part1()#;
  35.     part2()#;                   /* ==> Part1()# must finish execution before
  36.                                        Part2()# begins. */
  37.  
  38.     printf ("host says goodbye\n");
  39.   }
  40.  
  41. }
  42.